#pragma once

/*
	File:	TextureManager.h
	Author:	TJ Ashby
	
	Comments:	Handles all images/textures for our game and can manipulate them.
*/

#include "DirectX.h"
#include <vector>

class TextureManager
{
	// Singleton
	TextureManager(void);
	~TextureManager(void);

	// The sprite manager
	ID3DXSprite		 *spriteManager;
	IDirect3DDevice9 *d3dDevice;

	// List of all the textures
	std::vector<IDirect3DTexture9*> textureList;

public:
	static TextureManager* getInstance();

	void Initialize();
	void Shutdown();

	void BeginDraw();
	void EndDraw();
	void Flush();
	
	int LoadTexture(String Destination);
	void UnloadTexture(int ImageID);

	void Draw(int ImageID,Vector2 Position,Vector2 Center = Vector2(0,0),const RECT *Section = nullptr,float Rotation = 0,Vector2 Scale = Vector2(1,1),Color color = Color(1,1,1,1));

	// Access to the sprite manager
	ID3DXSprite * getSpriteManager() const { return spriteManager; }
};

